expander: Reinstate rtl allocation behavior
authorMatthias Clasen <mclasen@redhat.com>
Fri, 4 Mar 2016 02:28:08 +0000 (21:28 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Mar 2016 02:28:51 +0000 (21:28 -0500)
In rtl mode, we must not just reverse the children,
but also allocate from the right. Use the newly introduced
box gadget api to achieve this.

https://bugzilla.gnome.org/show_bug.cgi?id=762945

gtk/gtkexpander.c

index f6cea5c188c7ad2308b2a8e21bb3bffc6ffe1e09..3f32da4f85acae2279cd3d9a0491fe8bb736a9a1 100644 (file)
@@ -787,6 +787,9 @@ gtk_expander_direction_changed (GtkWidget        *widget,
   gtk_box_gadget_remove_gadget (GTK_BOX_GADGET (priv->gadget), priv->title_gadget);
   gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), 0, priv->title_gadget, FALSE, FALSE, align);
 
+  gtk_box_gadget_set_allocate_reverse (GTK_BOX_GADGET (priv->title_gadget),
+                                       gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
+
   GTK_WIDGET_CLASS (gtk_expander_parent_class)->direction_changed (widget, previous_direction);
 }